<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
//条件判断
    let xhs=5,xg=1; 
    if(xg>0){
        xhs>1;
    }
    console.log(xhs); 
    console.log('---------------------------')
    /* if(条件表达式){
        条件为真
    }else{
        条件不为真
    }*/
    //取两个值中的最大值
    let num1=100,num2=456,max; 
    if(num1>num2){
        max=num1;
    }else {
        max=num2;
    }
    console.log('最大值是:'+max); 
    console.log('---------------------------')
    let num3=100,num4=100;
     if(num3>num4){
        max=num3;
    }else if(num3=num4) {
        max=num4=num3;
    }else {
        max=num4;
    }
    console.log('最大值是:'+max);
    console.log('-------------------------'); 
    let a =prompt(); 
    let b =prompt();
    let min ;
    if(a>b){
     max=a;
    }else if(a<b) {
    max=b;
    }
    else{
    console.log('a和b相等');
    }
    console.log('最小值是:'+min);

</script>
</html>